package equipment_management

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type DeviceRouter struct {}

// InitDeviceRouter 初始化 全部设备 路由信息
func (s *DeviceRouter) InitDeviceRouter(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
	devRouter := Router.Group("dev").Use(middleware.OperationRecord())
	devRouterWithoutRecord := Router.Group("dev")
	devRouterWithoutAuth := PublicRouter.Group("dev")
	{
		devRouter.POST("createDevice", devApi.CreateDevice)   // 新建全部设备
		devRouter.DELETE("deleteDevice", devApi.DeleteDevice) // 删除全部设备
		devRouter.DELETE("deleteDeviceByIds", devApi.DeleteDeviceByIds) // 批量删除全部设备
		devRouter.PUT("updateDevice", devApi.UpdateDevice)    // 更新全部设备
	}
	{
		devRouterWithoutRecord.GET("findDevice", devApi.FindDevice)        // 根据ID获取全部设备
		devRouterWithoutRecord.GET("getDeviceList", devApi.GetDeviceList)  // 获取全部设备列表
	}
	{
	    devRouterWithoutAuth.GET("getDevicePublic", devApi.GetDevicePublic)  // 全部设备开放接口
	}
}
